package qf.com.dao.impl;

import org.apache.commons.dbutils.DbUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import qf.com.dao.longDao;
import qf.com.domain.User;
import qf.com.utils.DButils;

import java.sql.SQLException;

public class longdaoimpl implements longDao {
private QueryRunner queryRunner = new QueryRunner();
    User query = null;
    @Override
    public User deng(String yonghu, String mima) {

        String sql = "SELECT * FROM bbb WHERE username= ? AND password = ?";
        try {
            query = queryRunner.query(DButils.getConnection(), sql, new BeanHandler<>(User.class), yonghu, mima);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return query;
    }



}
